xlv.obj.borderLayout={
	extend:function(){
	},
	implement:function(){
	},
	create:function(tag){
		var div=document.createElement((tag||'div'));
		div.setAttribute('xlvobject','xlv.obj.borderLayout');
		Element.addClassName(div,'class_borderLayout');
		return div;
	},
	properties:{
		north:null,//{paneURL:'blank_pane.html',paneProperties:null,paneMethod:null}
		west:null,
		center:null,
		east:null,
		south:null
	},
	method:{
		construct:function(){
			var v=this.$V;
			var north,west,center,east,south;
			Element.addClassName(this,'class_borderLayout');
			north=xlv.util.findDirectChild(this,{id:'xlvid_north'});
			west=xlv.util.findDirectChild(this,{id:'xlvid_west'});
			center=xlv.util.findDirectChild(this,{id:'xlvid_center'});
			east=xlv.util.findDirectChild(this,{id:'xlvid_east'});
			south=xlv.util.findDirectChild(this,{id:'xlvid_south'});
			//
			var body,row;
			v.layout=document.createElement('table');
			v.layout.setAttribute('align','center');
			v.layout.setAttribute('id','xlvid_border_layout');
			v.layout.appendChild(body=document.createElement('tbody'));
			body.appendChild(row=document.createElement('tr'));
			row.appendChild(v.north=document.createElement('td'));
			v.north.colSpan=3;
			v.north.setAttribute('id','xlvid_north_pane');
			body.appendChild(row=document.createElement('tr'));
			row.appendChild(v.west=document.createElement('td'));
			v.west.setAttribute('id','xlvid_west_pane');
			row.appendChild(v.center=document.createElement('td'));
			v.center.setAttribute('id','xlvid_center_pane');
			row.appendChild(v.east=document.createElement('td'));
			v.east.setAttribute('id','xlvid_east_pane');
			body.appendChild(row=document.createElement('tr'));
			row.appendChild(v.south=document.createElement('td'));
			v.south.setAttribute('id','xlvid_south_pane');
			v.south.colSpan=3;
			if(north) v.north.appendChild(north);
			if(west) v.west.appendChild(west);
			if(center) v.center.appendChild(center);
			if(east) v.east.appendChild(east);
			if(south) v.south.appendChild(south);
			/*
			var rem=(!center)?v.center:v.south;
			while(this.firstChild) rem.appendChild(this.firstChild);
			*/
			this.appendChild(v.layout);
			this.styleFor(this);
			this.styleForId(v.layout,v.layout.id);
			this.styleForId(v.north,v.north.id);
			this.styleForId(v.west,v.west.id);
			this.styleForId(v.center,v.center.id);
			this.styleForId(v.east,v.east.id);
			this.styleForId(v.south,v.south.id);
		},
		initial:function(){
			var p=this.$P;
			if(p.north)this.setNorthPane(p.north.paneURL,p.north.paneProperties,p.north.Method);
			if(p.west)this.setWestPane(p.west.paneURL,p.west.paneProperties,p.west.Method);
			if(p.center)this.setCenterPane(p.center.paneURL,p.center.paneProperties,p.center.Method);
			if(p.east)this.setEastPane(p.east.paneURL,p.east.paneProperties,p.east.Method);
			if(p.south)this.setSouthPane(p.south.paneURL,p.south.paneProperties,p.south.Method);
		},
		styleFor:function(border_layout){
		},
		styleForId:function(layout,id){
		},
		showNorthPane:function(onoff){
			this._showPane(this.$V.north,onoff);
		},
		showWestPane:function(onoff){
			this._showPane(this.$V.west,onoff);
		},
		showCenterPane:function(onoff){
			this._showPane(this.$V.center,onoff);
		},
		showEastPane:function(onoff){
			this._showPane(this.$V.east,onoff);
		},
		showSouthPane:function(onoff){
			this._showPane(this.$V.south,onoff);
		},
		_showPane:function(layout,onoff){
			if(layout)layout.style.display=(onoff)?'':'none';
		},
		setNorthPane:function(url,properties,method,pane_in){
			pane_in=(pane_in||'top');
			this.$V.northURL=url;
			this._setPane(this.$V.north,url,properties,method,pane_in);
		},
		setWestPane:function(url,properties,method,pane_in){
			pane_in=(pane_in||'left');
			this.$V.westURL=url;
			this._setPane(this.$V.west,url,properties,method,pane_in);
		},
		setCenterPane:function(url,properties,method,pane_in){
			pane_in=(pane_in||'left-top');
			this.$V.centerURL=url;
			this._setPane(this.$V.center,url,properties,method,pane_in);
		},
		setEastPane:function(url,properties,method,pane_in){
			pane_in=(pane_in||'right');
			this.$V.eastURL=url;
			this._setPane(this.$V.east,url,properties,method,pane_in);
		},
		setSouthPane:function(url,properties,method,pane_in){
			pane_in=(pane_in||'bottom');
			this.$V.southURL=url;
			this._setPane(this.$V.south,url,properties,method,pane_in);
		},
		getPaneURL:function(pos){
			return 'north'==pos?this.$V.northURL:
				   'west'==pos?this.$V.westURL:
				   'center'==pos?this.$V.centerURL:
				   'east'==pos?this.$V.eastURL:
				   'south'==pos?this.$V.southURL:'';
		},
		_setPane:function(layout,url,properties,method,pane_in){
			if(!layout)return;
			pane_in=(pane_in||'left-top');
			var layoutid=layout.id.replace('_pane','');
			var content=xlv.util.findDirectChild(layout,{id:layoutid});
			content=(content)?content:layout;
			xlv.sys.dispose(content);
			var offset=this.getDesktop().viewportOffset(content);
			var dim=Element.getDimensions(content);
			var div=document.createElement('div');
			Element.setStyle(div,{position:'relative',width:dim.width+'px',height:dim.height+'px'});
			while(content.firstChild) div.appendChild(content.firstChild);
			content.appendChild(div);
			var glass=document.createElement('div');
			Element.setStyle(glass, {position:'absolute',left:'0px',top:'0px',right:'0px',bottom:'0px',opacity:0.3,background:'white',zIndex:xlv.sys.zIndexModal,cursor:'progress'});
			div.appendChild(glass);
			var wait=document.createElement('img');
			wait.setAttribute('src',xlv.obj.ajaxPane.pub.loading);
			Element.setStyle(wait,{position:'absolute',left:'4px',top:'4px',zIndex:'1000'});
			div.appendChild(wait);
			content.style.overflow='hidden';
			var ajax=xlv.sys.newInstance(content,'ajaxPane',{paneIn:pane_in,paneURL:url,paneProperties:properties,paneMethid:method});
			ajax.effect=(function(pane,original_style){
				content.removeChild(div);
				content.style.overflow='visible';
				this.$self('effect',pane,original_style);
			}).bind(ajax);
		}
	}
};
